<template>
	<view class="home">
		<view class="top">
			<view  @click="setaddr" style="position: relative;height: 60rpx; width: 130rpx;">
				<image style="position: absolute;top: 10rpx; left: 15rpx; height: 40rpx; width: 45rpx;" src="../../static/md-room_f5u0Q0w@1x.png" mode=""></image>
				<image style="position: absolute;top: 35rpx;left: 21rpx; height: 18rpx; width:32rpx;" src="../../static/cile.png" mode=""></image>
				<text style="position: absolute; top:10rpx; left: 60rpx;">{{ip}}</text>
			</view>
			<input placeholder="搜索医院·科室·疾病·医生" placeholder-class="jj" type="text" style="height:60rpx; padding-left: 20rpx; padding-right: 20rpx; box-sizing: border-box; width: 450rpx; box-shadow:0rpx 0rpx 5rpx 1rpx #EEF3FF; border-radius: 55rpx;" />
			<image style="height: 50rpx; width: 50rpx;margin-right: 20rpx;" src="/static/123.png" mode=""></image>
		</view>
	</view>
</template>

<script setup lang="ts">
import { onMounted,ref } from 'vue'
const formData = ref({})
const ip = ref('未知')
onMounted(()=>{
	uni.chooseLocation({
		success: function (res) {
			ip.value = res.address.split('省')[1].split('市')[0]
		}
	});
})
const setaddr = ()=>{
	uni.chooseLocation({
		success: function (res) {
			ip.value = res.address.split('省')[1].split('市')[0]
		}	
	});
}
</script>

<style>
	.top{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 120rpx;
		padding-top: 55rpx;
		background-color: #FFFFFF;
		display: flex;
		justify-content: space-around;
		align-items: center;
	}
	.home{
		height: 100%;
		width: 100%;
		background-color:#F7F8FF;
		padding-top: 175rpx;
	}
	.jj{
		color: darkgray;
	}
</style>
